package modele;

public class Med implements Comparable<Med> {
    private String nom;
    private String prenom;
    private String adresse;
    private String tel;
    private String spe;
    private String id;
    private String dep;
    
    public Med(String nom, String prenom, String adresse, String tel, String spe, String id, String Dep) {
        this.nom = nom;
        this.prenom = prenom;
        this.adresse = adresse;
        this.tel = tel;
        this.spe = spe;
        this.id = id;
    }
    public String getAdresse() {
        return adresse;
    }
    public String getNom() {
        return nom;
    }
    public String getPrenom() {
        return prenom;
    }
    public String getSpe() {
        return spe;
    }
    public String getTel() {
        return tel;
    }
    public String getId() {
        return id;
    }
    public String getDep() {
        return dep;
    }
    @Override
    public int compareTo(Med m) {
        if (nom.compareTo(m.getNom()) == 0) {
            if (prenom.compareTo(m.getPrenom()) == 0) {
                return id.compareTo(m.getId());
            }
            return prenom.compareTo(m.getPrenom());
        } else {
            return nom.compareTo(m.getNom());
        }
    }
}
